#include "YetiDistanceDecision.h"
#include "EntityManager.h"

DecisionTreeNode<YetiEnemy>* YetiDistanceDecision::getBranch(YetiEnemy* enemy)
{
	Entity* player = EntityManager::getNamedEntities("Player")->front();
	float dist = D3DXVec3Length(&(player->getPosition() - enemy->getPosition()));
	if (dist < distance)
		return trueNode;
	else
		return falseNode;
}

